package net.risesoft.y9.pubsub.message;

import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonTypeInfo;

/**
 *  组织消息
 *  
 * @author dingzhaojun
 * @author qinman
 * @author mengjuhua
 * @date 2022/2/10
 */
public class Y9MessageOrg implements Serializable {
    private static final long serialVersionUID = 6408566736524500841L;

    // 解决 jackson 序列化丢失类型
    @JsonTypeInfo(use = JsonTypeInfo.Id.CLASS)
    private Serializable orgObj;
    private String eventType;
    private String eventTarget;
    private String tenantId;

    public Y9MessageOrg() {}

    public Y9MessageOrg(Serializable orgObj, String eventType, String eventTarget, String tenantId) {
        this.orgObj = orgObj;
        this.eventType = eventType;
        this.eventTarget = eventTarget;
        this.tenantId = tenantId;
    }

    public String getEventTarget() {
        return eventTarget;
    }

    public String getEventType() {
        return eventType;
    }

    public Serializable getOrgObj() {
        return orgObj;
    }

    public String getTenantId() {
        return tenantId;
    }

    public void setEventTarget(String eventTarget) {
        this.eventTarget = eventTarget;
    }

    public void setEventType(String eventType) {
        this.eventType = eventType;
    }

    public void setOrgObj(Serializable orgObj) {
        this.orgObj = orgObj;
    }

    public void setTenantId(String tenantId) {
        this.tenantId = tenantId;
    }

    @Override
    public String toString() {
        return "Y9MessageOrg [eventType=" + eventType + ", eventTarget=" + eventTarget + ", tenantId=" + tenantId + "]";
    }

}